package lesson3;

import java2d.game.Game;
import java2d.game.GameScene;
import lesson3.models.Enemy;
import lesson3.models.EnemySpawner;
import lesson3.models.Explosion;
import lesson3.models.Player;

import java.awt.*;

/**
 * Author:     Zhao Yan
 * DateTime:   2023/4/18 18:33
 */
public class App {

    public static void main(String[] args) {
        Game game = new Game();
//        Game.debugEnabled = true;
        GameScene scene = game.getScene();
        Dimension renderSize = game.getRenderSize();

        // 自上而下的Spawner
        EnemySpawner spawner = new EnemySpawner(0, -renderSize.height * 0.5);
        scene.add(spawner);

        // 自左而右的Spawner
        EnemySpawner leftSpawner = new EnemySpawner(-renderSize.width * 0.5, 0);
        leftSpawner.direction.setLocation(1.0, 0);
        leftSpawner.isHorizontal = false;
//        scene.add(leftSpawner);

        // 自右而左的Spawner
        EnemySpawner rightSpawner = new EnemySpawner(renderSize.width * 0.5, 0);
        rightSpawner.direction.setLocation(-1.0, 0);
        rightSpawner.isHorizontal = false;
//        scene.add(rightSpawner);

        Enemy enemy = new Enemy();
        enemy.transform.setPosition(0, -200);
        enemy.translator.enabled = false;
        enemy.canShoot = false;
        scene.add(enemy);

        Player player = new Player();
        player.canMove = false;
        scene.add(player);
    }
}
